function validate() {
	var result = true;
	var addcode = document.getElementById('addcode').value;
	var passwd = document.getElementById('password').value;
	var username = document.getElementById('username').value;
	var gender = document.getElementById('gender').value;
	var state = document.getElementById('state').value;
	if (addcode == '') {
		document.getElementById('addcodeTip').innerHTML = '<img src="img/err.png"/><font color="red">帐号不能为空！</font>'
		result = false;
	} else if (addcode.length < 5 || addcode.length > 12) {
		document.getElementById('addcodeTip').innerHTML = '<img src="img/err.png"/><font color="red">帐号的长度必须在5~12之间！</font>'
		result = false;
	}else {
		document.getElementById('addcodeTip').innerHTML = '<img src="img/ok.png"/>';
	}

	
	if (passwd == '') {
		document.getElementById('passwordTip').innerHTML = '<img src="img/err.png"/><font color="red">密码不能为空！</font>'
		result = false;
	} else if (passwd.length < 6 || passwd.length > 12) {
		document.getElementById('passwordTip').innerHTML = '<img src="img/err.png"/><font color="red">密码的长度必须在6~12之间！</font>'
		result = false;
	} else {
		document.getElementById('passwordTip').innerHTML = '<img src="img/ok.png"/>';
	}

	
	if (/\d$/.test(username)) {
		document.getElementById('usernameTip').innerHTML = '<img src="img/err.png"/><font color="red">姓名中不能有数字!</font>'
		result = false;
	} else if (username == '') {
		document.getElementById('usernameTip').innerHTML = '<img src="img/err.png"/><font color="red">姓名不能为空!</font>'
		result = false;
	} else {
		document.getElementById('usernameTip').innerHTML = '<img src="img/ok.png"/>';
	}

	
	if (gender == 1) {
		document.getElementById('genderTip').innerHTML = '<img src="img/ok.png"/>';
	} else if (gender == 2) {
		document.getElementById('genderTip').innerHTML = '<img src="img/ok.png"/>';
	} else {
		document.getElementById('genderTip').innerHTML = '<img src="img/err.png"/><font color="red">请输入1或者2</font>'
		result = false;
	}

	
	if (state == 1) {
		document.getElementById('stateTip').innerHTML = '<img src="img/ok.png"/>';
	} else if (state == 2) {
		document.getElementById('stateTip').innerHTML = '<img src="img/ok.png"/>';
	} else {
		document.getElementById('stateTip').innerHTML = '<img src="img/err.png"/><font color="red">请输入1或者2</font>'
		result = false;
	}

	
	return result;
}
function validate2() {
	var result = true;
	var addcode = document.getElementById('addcode').value;
	
	if (addcode == '') {
		document.getElementById('addcodeTip').innerHTML = '<img src="img/err.png"/><font color="red">帐号不能为空！</font>'
		result = false;
	} else if (addcode.length < 5 || addcode.length > 12) {
		document.getElementById('addcodeTip').innerHTML = '<img src="img/err.png"/><font color="red">帐号的长度必须在5~12之间！</font>'
		result = false;
	}else {
		document.getElementById('addcodeTip').innerHTML = '<img src="img/ok.png"/>';
	}
	return result;
}
function validate3() {
	var result = true;
	
	var passwd = document.getElementById('password').value;
	

	
	if (passwd == '') {
		document.getElementById('passwordTip').innerHTML = '<img src="img/err.png"/><font color="red">密码不能为空！</font>'
		result = false;
	} else if (passwd.length < 6 || passwd.length > 12) {
		document.getElementById('passwordTip').innerHTML = '<img src="img/err.png"/><font color="red">密码的长度必须在6~12之间！</font>'
		result = false;
	} else {
		document.getElementById('passwordTip').innerHTML = '<img src="img/ok.png"/>';
	}
	return result;
}


function validate4() {
	var result = true;
	
	var username = document.getElementById('username').value;
	

	
	if (/\d$/.test(username)) {
		document.getElementById('usernameTip').innerHTML = '<img src="img/err.png"/><font color="red">姓名中不能有数字!</font>'
		result = false;
	} else if (username == '') {
		document.getElementById('usernameTip').innerHTML = '<img src="img/err.png"/><font color="red">姓名不能为空!</font>'
		result = false;
	} else {
		document.getElementById('usernameTip').innerHTML = '<img src="img/ok.png"/>';
	}

	
	return result;
}

function validate5() {
	var result = true;

	var gender = document.getElementById('gender').value;

	if (gender == 1) {
		document.getElementById('genderTip').innerHTML = '<img src="img/ok.png"/>';
	} else if (gender == 2) {
		document.getElementById('genderTip').innerHTML = '<img src="img/ok.png"/>';
	} else {
		document.getElementById('genderTip').innerHTML = '<img src="img/err.png"/><font color="red">请输入1或者2</font>'
		result = false;
	}


	
	return result;
}



function validate6() {
	var result = true;

	var state = document.getElementById('state').value;

	if (state == 1) {
		document.getElementById('stateTip').innerHTML = '<img src="img/ok.png"/>';
	} else if (state == 2) {
		document.getElementById('stateTip').innerHTML = '<img src="img/ok.png"/>';
	} else {
		document.getElementById('stateTip').innerHTML = '<img src="img/err.png"/><font color="red">请输入1或者2</font>'
		result = false;
	}

	
	return result;
}